package com.sengled.cloud.biz.union.mgt.dao.sys;


import com.sengled.cloud.biz.union.mgt.dao.sys.provider.RoleModulePermissionDaoProvider;
import com.sengled.cloud.biz.union.mgt.dao.sys.provider.ShopAccountModuleDaoProvider;
import com.sengled.cloud.biz.union.mgt.model.po.ShopAccountModule;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ShopAccountModuleDao {

    @Delete("delete shop_account_module where id = #{id}")
    int deleteByPrimaryKey(Long id);

    @Delete("delete from shop_account_module where shop_account_id = #{shopAccountId}")
    int deleteByShopAccountKey(Long shopAccountId);

    @Insert("insert into shop_account_module(shop_account_id,module_id,create_date) values(#{record.shopAccountId},#{record.moduleId},#{record.createDate})")
    int insert(ShopAccountModule record);

    int insertSelective(ShopAccountModule record);

    @Select("select id as id,shop_account_id as shopAccountId,module_id as moduleId,create_date as createDate from shop_account_module where id = #{id}")
    ShopAccountModule selectByPrimaryKey(Long id);


    int updateByPrimaryKeySelective(ShopAccountModule record);

    int updateByPrimaryKey(ShopAccountModule record);

    @Select("select id as id,shop_account_id as shopAccountId,module_id as moduleId,create_date as createDate from shop_account_module where shop_account_id = #{shopAccountId}")
    List<ShopAccountModule> selectShopAccountModuleList(@Param("shopAccountId") Long shopAccountId);

    @InsertProvider(type = ShopAccountModuleDaoProvider.class, method = "batchInsert")
    int batchInsert(@Param("shopAccountId") Long shopAccountId,@Param("moduleIds") List<Long> moduleIds);
}